package demo.channel.impl;

import demo.channel.AbstractPayChannel;
import demo.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @author ZhouWeiBo
 * @create 2022/6/8
 */
public class PayPalChannel extends AbstractPayChannel {

    public PayPalChannel(IPayMode payMode) {
        super(payMode);
    }

    @Override
    public boolean pay(String userId, Object identity, BigDecimal money) {
        System.out.println("欢迎使用支付宝，正在支付中~！");
        if (!payMode.verify(userId,identity)){
            System.out.println("抱歉，正在失败了~！");
            return false;
        }else{
            System.out.println("感谢使用支付宝，支付成功~！");
            return true;
        }
    }
}
